home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
-
- Enumerate.c
- Last Modified: Friday, May 31, 1991 at 9:46 PM
-
- Convert a string to a C version of the string
-
- © Copyright Evatac Software 1988-1990
- All rights reserved
-
- ************************************************************/
-
- #include "PCMD.h"
- #include <Strings.h>
- #include <Packages.h>
- #include <Memory.h>
-
- typedef struct MyGlobals {
- short count;
- } MyGlobals;
-
- main(
- unsigned char *sourceText,
- long sourceLength,
- unsigned char *destText,
- long *destSpace,
- PCMDInfo *info
- )
- {
- MyGlobals *globals;
- short length;
-
- if (sourceLength + 5 > *destSpace)
- return(kPCMDMoreSpace);
-
- globals = (MyGlobals *) info->globals;
-
- if (FirstLine(info))
- globals->count = 0;
- globals->count++;
-
- *destText = '0' + globals->count;
- length = 1;
- // NumToString(globals->count, destText);
- // length = (short) *destText;
- // p2cstr(destText);
- destText += length;
- *(destText++) = '.';
- *(destText++) = 9;
-
- BlockMove(sourceText, destText, sourceLength);
- *destSpace = sourceLength + length + 2;
-
- return(kPCMDSuccess);
- }
-
-